<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Dropio_Api</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Dropio_Api</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
											<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
						
			</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Dropio_Api is a client for the Dropio API and the basis for all the other  helper classes.</p>
<p class="description"><p>This can be used to access all the functionality of the API.</p><p>If an error is returned from the API, a Dropio_Api_Exception is thrown.</p><p>Example to get details on a drop.</p><p>try {   $api = new Dropio_Api(API_KEY);   $response = $api-&gt;request('GET', '/drops/php_api_lib');   print_r($response);  } catch (Dropio_Api_Exception $e) {   die(&quot;Error:&quot; . $e-&gt;getMessage());  }</p></p>
		<p class="notes">
			Located in <a class="field" href="_Api.php.html">/Api.php</a> (line <span class="field">42</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>


	<a name="sec-const-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constant Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Constants</span> (<a href="#sec-consts">details</a>)
												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="const-summary">
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#API_HTTPS_URL" title="details" class="const-name">API_HTTPS_URL</a> = 					<span class="var-type"> 'http://api.drop.io'</span>

				</div>
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#API_HTTP_URL" title="details" class="const-name">API_HTTP_URL</a> = 					<span class="var-type"> 'http://api.drop.io'</span>

				</div>
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#API_VERSION" title="details" class="const-name">API_VERSION</a> = 					<span class="var-type"> '2.0'</span>

				</div>
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#CLIENT_VER" title="details" class="const-name">CLIENT_VER</a> = 					<span class="var-type"> '1.0'</span>

				</div>
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#RESPONSE_FORMAT" title="details" class="const-name">RESPONSE_FORMAT</a> = 					<span class="var-type"> 'json'</span>

				</div>
								<div class="const-title">
					<img src="../media/images/Constant.png" alt=" " />
					<a href="#UPLOAD_URL" title="details" class="const-name">UPLOAD_URL</a> = 					<span class="var-type"> 'http://assets.drop.io/upload'</span>

				</div>
							</div>
		</div>
	</div>

	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="var-summary">
																				<div class="var-title">
					static <span class="var-type">mixed</span>
					<a href="#$api_url" title="details" class="var-name">$api_url</a>
				</div>
																<div class="var-title">
					static <span class="var-type">mixed</span>
					<a href="#$global_api_key" title="details" class="var-name">$global_api_key</a>
				</div>
																<div class="var-title">
					static <span class="var-type">mixed</span>
					<a href="#$use_https" title="details" class="var-name">$use_https</a>
				</div>
																				<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$api_key" title="details" class="var-name">$api_key</a>
				</div>
																																			</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																				<div class="method-definition">
					static 						<span class="method-result"><a href="../default/Dropio_Api.html">Dropio_Api</a></span>
										<a href="#instance" title="details" class="method-name">instance</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span> = <span class="var-default">null</span>])
									</div>
																								<div class="method-definition">
					static 						<span class="method-result">void</span>
										<a href="#setApiUrl" title="details" class="method-name">setApiUrl</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$url</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">void</span>
										<a href="#setKey" title="details" class="method-name">setKey</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span>)
									</div>
								
												<div class="method-definition">
											<span class="method-result">Dropio_Api</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span> = <span class="var-default">null</span>])
									</div>
																								<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#request" title="details" class="method-name">request</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">array()</span>])
									</div>
																								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
												<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$api_url" id="$api_url"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			static <span class="var-type">mixed</span>
			<span class="var-name">$api_url</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">51</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$global_api_key" id="$global_api_key"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			static <span class="var-type">mixed</span>
			<span class="var-name">$global_api_key</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">48</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$use_https" id="$use_https"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			static <span class="var-type">mixed</span>
			<span class="var-name">$use_https</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">50</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$api_key" id="$api_key"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$api_key</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">47</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																			<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodinstance" id="instance"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method instance</span> (line <span class="line-number">88</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Instance method to allow simple chaining.</p>
<p class="description"><p>Example:</p><p>$response = Dropio_Api::instance()-&gt;request('GET', '/drops/php_api_lib');</p></p>
	
	<div class="method-signature">
	    static
		<span class="method-result"><a href="../default/Dropio_Api.html">Dropio_Api</a></span>
		<span class="method-name">
			instance
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$api_key</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetApiUrl" id="setApiUrl"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method setApiUrl</span> (line <span class="line-number">113</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the global api_key.</p>
	
	<div class="method-signature">
	    static
		<span class="method-result">void</span>
		<span class="method-name">
			setApiUrl
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$url</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$api_key</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$url</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetKey" id="setKey"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method setKey</span> (line <span class="line-number">102</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the global api_key.</p>
	
	<div class="method-signature">
	    static
		<span class="method-result">void</span>
		<span class="method-name">
			setKey
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$api_key</span>			</li>
				</ul>
		
			
	</div>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">64</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">instantiates a new Dropio_Api object.  The api_key is optional, if not set  it uses the global api_key set by: Dropio_Api::setKey(API_KEY);</p>
	
	<div class="method-signature">
		<span class="method-result">Dropio_Api</span>
		<span class="method-name">
			__construct
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$api_key</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$api_key</span>			</li>
				</ul>
		
			
	</div>
<a name="methodrequest" id="request"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">request</span> (line <span class="line-number">126</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Executes a request to Drop.io's API servers.</p>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			request
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$params</span> = <span class="var-default">array()</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$method</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$params</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	<a name="sec-consts"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Constants</a> (<span class="disabled">details</span>)
						
			
												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="constAPI_HTTPS_URL" id="API_HTTPS_URL"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">API_HTTPS_URL</span>
			 = <span class="const-default"> 'http://api.drop.io'</span>
			(line <span class="line-number">53</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constAPI_HTTP_URL" id="API_HTTP_URL"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">API_HTTP_URL</span>
			 = <span class="const-default"> 'http://api.drop.io'</span>
			(line <span class="line-number">52</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constAPI_VERSION" id="API_VERSION"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">API_VERSION</span>
			 = <span class="const-default"> '2.0'</span>
			(line <span class="line-number">45</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constCLIENT_VER" id="CLIENT_VER"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">CLIENT_VER</span>
			 = <span class="const-default"> '1.0'</span>
			(line <span class="line-number">54</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constRESPONSE_FORMAT" id="RESPONSE_FORMAT"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">RESPONSE_FORMAT</span>
			 = <span class="const-default"> 'json'</span>
			(line <span class="line-number">44</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constUPLOAD_URL" id="UPLOAD_URL"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">UPLOAD_URL</span>
			 = <span class="const-default"> 'http://assets.drop.io/upload'</span>
			(line <span class="line-number">55</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
						
		</div>
	</div>

	<p class="notes" id="credit">
		Documentation generated on Thu, 17 Dec 2009 16:13:01 -0500 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
	</p>
	</div></body>
</html>